package com.soup.lab.tools.faker.source;

import java.io.*;
import java.nio.charset.Charset;
import java.nio.file.Path;

public interface FileSource extends InputStreamSource, ReaderSource {

    File getFile();

    Path getPath();

    @Override
    default InputStream getAsInputStream() throws FileNotFoundException {
        File file = getFile();
        return file == null ? null : new FileInputStream(file);
    }

    @Override
    default Charset getCharset() {
        return Charset.defaultCharset();
    }
}
